{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting pyecharts\n",
      "  Downloading https://files.pythonhosted.org/packages/d2/1a/a094c0d11c3c87cf407cbd9dc069882e9bba08374df1ad81dfb39de1a8d3/pyecharts-1.9.0-py3-none-any.whl (135kB)\n",
      "Collecting simplejson (from pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/31/88/790961cd4d6a235aa5f624d51a99520ba4f3064f5a7bb212c13c474543c6/simplejson-3.17.5-cp36-cp36m-win_amd64.whl (75kB)\n",
      "Collecting prettytable (from pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/de/56/554603797416219cae8fd3eae33e5e2d58a7fc73419129b62fa419a67856/prettytable-2.4.0-py3-none-any.whl\n",
      "Requirement already satisfied: jinja2 in c:\\users\\zdnf\\anaconda3\\lib\\site-packages (from pyecharts) (2.10)\n",
      "Requirement already satisfied: wcwidth in c:\\users\\zdnf\\anaconda3\\lib\\site-packages (from prettytable->pyecharts) (0.1.7)\n",
      "Collecting importlib-metadata; python_version < \"3.8\" (from prettytable->pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/c4/1f/e2238896149df09953efcc53bdcc7d23597d6c53e428c30e572eda5ec6eb/importlib_metadata-4.8.2-py3-none-any.whl\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\zdnf\\anaconda3\\lib\\site-packages (from jinja2->pyecharts) (1.0)\n",
      "Collecting zipp>=0.5 (from importlib-metadata; python_version < \"3.8\"->prettytable->pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/bd/df/d4a4974a3e3957fd1c1fa3082366d7fff6e428ddb55f074bf64876f8e8ad/zipp-3.6.0-py3-none-any.whl\n",
      "Collecting typing-extensions>=3.6.4; python_version < \"3.8\" (from importlib-metadata; python_version < \"3.8\"->prettytable->pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/17/61/32c3ab8951142e061587d957226b5683d1387fb22d95b4f69186d92616d1/typing_extensions-4.0.0-py3-none-any.whl\n",
      "Installing collected packages: simplejson, zipp, typing-extensions, importlib-metadata, prettytable, pyecharts\n",
      "Successfully installed importlib-metadata-4.8.2 prettytable-2.4.0 pyecharts-1.9.0 simplejson-3.17.5 typing-extensions-4.0.0 zipp-3.6.0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "distributed 1.21.8 requires msgpack, which is not installed.\n",
      "You are using pip version 10.0.1, however version 21.3.1 is available.\n",
      "You should consider upgrading via the 'python -m pip install --upgrade pip' command.\n"
     ]
    }
   ],
   "source": [
    "!pip install pyecharts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "c = (\n",
    "    Bar({\"theme\": ThemeType.MACARONS})\n",
    "    .add_xaxis([\"Alex\",\"XiaoMing\",\"Xiaohu\",\"Marry\",\"Jack\",\"Jan\",\"Lihua\"])\n",
    "    .add_yaxis(\"一千米\", [3.45,4.15,3.56,3.20,4.00,4.00,4.20])\n",
    "    .add_yaxis(\"立定跳远\", [2.5,2.6,2.4,2.3,2.5,2.4,2.45])\n",
    "    .set_global_opts(\n",
    "        title_opts={\"text\": \"Bar-通过 dict 进行配置\", \"subtext\": \"我也是通过 dict 进行配置的\"}\n",
    "    )\n",
    "    .render(\"bar_base_dict_config.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['河马', '蟒蛇', '老虎', '大象', '兔子', '熊猫', '狮子']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.choose()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "names = [\"Alex\",\"XiaoMing\",\"Xiaohu\",\"Marry\",\"Jack\",\"Jan\",\"Lihua\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[119, 92, 67, 102, 21, 113, 129]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.values()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "一千米 = [3.45,4.15,3.56,3.20,4.00,4.00,4.20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "立定跳远 = [2.5,2.6,2.4,2.3,2.5,2.4,2.45]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
